package org.example.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.entity.PsychReply;
import org.example.mapper.PsychReplyMapper;
import org.example.service.PsychReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PsychReplyServiceImpl
 * @Description TODO
 * @Author lipeijin
 * @Date 2025年08月16日 下午7:08
 * @Version 1.0
 */
@Service
public class PsychReplyServiceImpl implements PsychReplyService {
    @Autowired
    private PsychReplyMapper psychReplyMapper;
    @Override
    public PageInfo<PsychReply> getPage(int id, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PsychReply> psychReplies = psychReplyMapper.getPage(id);
        PageInfo pageInfo = new PageInfo(psychReplies);
        return pageInfo;
    }

    @Override
    public int addPsychReply(PsychReply psychReply) {
        return psychReplyMapper.addPsychReply(psychReply);
    }
}
